/**
 * 返回顶部
 */
window.onscroll = function () {
    toToTop()
}

function toToTop() {
    const topBtn = document.querySelector('.back-top')
    if (document.body.scrollTop > 150 || document.documentElement.scrollTop > 150) {
        topBtn.style.display = "block";
    } else {
        topBtn.style.display = "none";
    }

    topBtn.onclick = function () {
        document.body.scrollTop = 0;
        document.documentElement.scrollTop = 0;
    }
}
toToTop()

// 返回首页
function BackToHome(){
    location.href = 'index.html'
}